<@master template="common/default" title="新增流程节点模板">
<div class="detailsBox">
	<h3>
		<i class="jtIco"></i>新增流程节点模板
	</h3>
	<form action="/node/template/save" method="post" class="action-ajax-form">
		<div class="detaiTab">
			<table width="100%" cellspacing="0" cellpadding="0" border="0">
				<tbody>
					<tr>
						<td width="15%" align="right" class="bg">节点名称：</td>
						<td><input type="text" name="nodeName"
							value="${processNodeTemplate.nodeName}" class="tabInp action-valid-field" style="width:250px">
							<span class="action-field-error" for="nodeName"></span>
						</td>
					</tr>
					<tr>
						<td width="15%" align="right" class="bg">节点编码：</td>
						<td><input type="text" name="nodeCode"
							value="${processNodeTemplate.nodeCode}" class="tabInp action-valid-field" style="width:250px">
							<span class="action-field-error" for="nodeCode"></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">节点描述：</td>
						<td><input type="text" name="nodeDesc"
							value="${processNodeTemplate.nodeDesc}" class="tabInp action-valid-field" style="width:250px">
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">序号：</td>
						<td><input type="text" name="orderNo"
							value="${processNodeTemplate.orderNo}" class="tabInp action-valid-field">
							<span class="action-field-error" for="account"></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">操作:</td>
						<td>
							<#if processNodeTemplate.isSign = 1>
								<input type="checkbox" name="isSign" value="1" checked="checked"/>加签
							<#else>
								<input type="checkbox" name="isSign" value="0"/>加签
							</#if>
							<#if processNodeTemplate.isChange = 1>
								<input type="checkbox" name="isChange" value="1" checked="checked"/>转交
							<#else>
								<input type="checkbox" name="isChange" value="0"/>转交
							</#if>
							<#if processNodeTemplate.isReject = 1>
								<input type="checkbox" name="isReject" value="1" checked="checked"/>否决
							<#else>
								<input type="checkbox" name="isReject" value="0"/>否决
							</#if>
							<#if processNodeTemplate.isPass = 1>
								<input type="checkbox" name="isPass" value="1" checked="checked"/>通过
							<#else>
								<input type="checkbox" name="isPass" value="0"/>通过
							</#if>
							<#if processNodeTemplate.isTurnedDown = 1>
								<input type="checkbox" name="isTurnedDown" value="1" checked="checked"/>驳回
							<#else>
								<input type="checkbox" name="isTurnedDown" value="0"/>驳回
							</#if>
							<#if processNodeTemplate.isTakeBack = 1>
								<input type="checkbox" name="isTakeBack" value="1" checked="checked"/>收回
							<#else>
								<input type="checkbox" name="isTakeBack" value="0"/>收回
							</#if>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">节点类型：</td>
						<td><select id="node_type" name="node_type">
								<option value="-1" selected ="selected">--请选择--</option>
								<#list dicData as dic> 
									<option value="${dic.code}">${dic.name}</option>
								</#list> 
							</select>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">角色：</td>
						<td><select id="roleNo" name="roleNo">
								<option value="-1" selected ="selected">--请选择--</option>
								<#list roleList as role>
									<option value="${role.id}">${role.roleName}</option>
								</#list>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">动态表单地址：</td>
						<td><input type="text" name="referUrl"
							value="${processNodeTemplate.referUrl}" class="tabInp action-valid-field" style="width:450px">
							<span class="action-field-error" for="account"></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">节点时效：</td>
						<td><input type="text" name="timeEffective"
							value="${processNodeTemplate.timeEffective}" class="tabInp action-valid-field" style="width:450px">
							<span class="action-field-error" for="account"></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">通知方式：</td>
						<td>
							<#if processNodeTemplate.isSendEmail?? && processNodeTemplate.isSendEmail == 0>
								<input type="checkbox" name="isSendEmail" value="0"/>邮件
							<#else>
								<input type="checkbox" name="isSendEmail" value="1" checked="checked"/>邮件
							</#if>
							<#if processNodeTemplate.isSendSms?? && processNodeTemplate.isSendSms == 0>
								<input type="checkbox" name="isSendSms" value="0"/>短信
							<#else>
								<input type="checkbox" name="isSendSms" value="1" checked="checked"/>短信
							</#if>
							<#if processNodeTemplate.isSendWechat?? && processNodeTemplate.isSendWechat == 0>
								<input type="checkbox" name="isSendWechat" value="0"/>微信
							<#else>
								<input type="checkbox" name="isSendWechat" value="1" checked="checked"/>微信
							</#if>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">自动过单：</td>
						<td>
							<#if processNodeTemplate.isAutoAudit?? && processNodeTemplate.isAutoAudit == 1>
								<input type="radio" name="isAutoAudit" value="1" checked="checked"/>是
								<input type="radio" name="isAutoAudit" value="0"/>否
							<#else>
								<input type="radio" name="isAutoAudit" value="1"/>是
								<input type="radio" name="isAutoAudit" value="0" checked="checked"/>否
							</#if>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">加签类型：</td>
						<td>
							<@select type="checkbox" dataSouceType="SIGN_TYPE" name="signType" value="${processNodeTemplate.signType}" id="signType"/>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg">意见模板：</td>
						<td><textarea name="notesTemplate" class="tabInp action-valid-field" style="height:150px;width:450px">${processNodeTemplate.notesTemplate}</textarea>
							<span class="action-field-error" for="account"></span>
						</td>
					</tr>
					<tr>
						<td align="right" class="bg"></td>
						<td>
							<input type="hidden" value="${processTemplateId}" name="processNo"/>
							<input type="hidden" value="${nodeTemplateId}" name="nodeId"/>
							<input type="submit" class="btn_auto_30 btn_blue" value="保存"/>&nbsp;
							<a class="btn_auto_30 btn_blue ml10" href="<@url value='/wf/template/view?processNo=${processTemplateId}'/>">取消</a>
							<span style="color: red;">${massege}</span>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<table>
	</div>
		
</form>
<input id="nodeTypeHidden" type="hidden" value="${processNodeTemplate.nodeType}"/>
<input id="roleNoHidden" type="hidden" value="${processNodeTemplate.roleNo}"/>
</div>
</@master>


<@js>
	function render(){
		$('input[name="isSign"],input[name="isChange"],input[name="isReject"],input[name="isPass"],input[name="isTurnedDown"],input[name="isTakeBack"],input[name="isSendEmail"],input[name="isSendSms"],input[name="isSendWechat"]').bind("click",function(){
			if($(this).prop('checked'))
				$(this).val(1);
			else
				$(this).val(0);	
		});
		if($('#nodeTypeHidden').val()!=""){
			$('#node_type').val($('#nodeTypeHidden').val());
		}
		if($('#roleNoHidden').val() != ""){
			$('#roleNo').val($('#roleNoHidden').val());
		}
	}
	render();
</@js>
<@jsRender/>